<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="java.util.*" isELIgnored="false"
	import="com.jeremy.entity.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>修改用户信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="static/css/bootstrap.min.css" rel="stylesheet">
	<link href="static/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
	 
	<script src="static/js/jquery-3.4.0.min.js"></script>
	<script src="static/js/bootstrap.min.js"></script>
	<script src="static/js/bootstrap-datetimepicker.min.js"></script>
	<script src="static/js/bootstrap-datetimepicker.zh-CN.js"></script>

	  <script type="text/javascript">
		$(function () {
		    $('#datetimepicker').datetimepicker({
		        format: 'yyyy-mm-dd',
		        language:'zh-CN'
		    });
		});
	</script>

  </head>
  
  <body>
  	<!--通过bootstrap的栅格系统布局-->
	<div class="container">
		<!--标题-->
		<div class="row">
			<div class="col-md-12">
				<h1>SSM-CRUD-修改</h1>
				<h1>path:<%=path %></h1>
				<h1>basePath:<%=basePath %></h1>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				 <form class="form-horizontal" method="post" action="<%=path %>/updateUser">
			      <input type="hidden" class="form-control" name="id" value="${user.id }" placeholder="Email">
				  <div class="form-group">
				    <label for="name" class="col-sm-2 control-label">姓名</label>
				    <div class="col-sm-3">
				      <input id="name" class="form-control" name="name" value="${user.name }" placeholder="姓名">
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="age" class="col-sm-2 control-label">年龄</label>
				    <div class="col-sm-3">
				      <input id="age" class="form-control" name="age" value="${user.age }" placeholder="年龄">
				    </div>
				  </div>
				  <div class="form-group">
				  	<label for="sex" class="col-sm-2 control-label">性别</label>
				  	<div class="col-sm-3">
					  	<label class="radio-inline">
					  		<input type="radio" name="sex" ${(user.sex=='男')?'checked' : ''}  value="男"> 男
					    </label>
					     <label class="radio-inline">
					  		<input type="radio" name="sex" ${(user.sex=='女')?'checked' : ''} value="女"> 女
					    </label>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="birthdate" class="col-sm-2 control-label">出生日期</label>
			        <!--指定 date标记-->
			        <div class='input-group date col-sm-3' id='datetimepicker'>
			            <input type='text' name="birthdate" value="${user.birthdate.toLocaleString() }" class="form-control" placeholder="出生日期"/>
			            <span class="input-group-addon">
			                <span class="glyphicon glyphicon-calendar"></span>
			            </span>
			        </div>
				  </div>
				  <div class="form-group">
				    <div class="col-sm-offset-2 col-sm-10">
				      <button type="submit" class="btn btn-default">修改</button>
				    </div>
				  </div>
				</form>
			</div>
		</div>
    </div>
	</body>
</html>
